﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using aier.dataaccess.dapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
using aier.dataaccess.model;

namespace aier.dataaccess.dapper
{
    [TestClass()]
    public class CustomerUserDalUT
    {
        private CustomerUserDal customerUserDal = null;

        [TestInitialize]
        public void Init()
        {
            customerUserDal = new CustomerUserDal();
            customerUserDal.dapperHelper = new DapperHelper(ConfigurationManager.ConnectionStrings["Aier_Mobile_CRMDB"].ConnectionString);
        }

        [TestMethod()]
        public void QueryCustomerByAppIdAndOpenIdUT()
        {
            var obj = customerUserDal.QueryCustomerByAppIdAndOpenId("wx1d19f2376212d6d3", "oloOkxM0CWrUM0o_JIOLfEwhCghE");
            Console.WriteLine(obj.USERID);
        }

        [TestMethod()]
        public void SaveCustomerUserUT()
        {
            CustomerUserView cv = new CustomerUserView();
            cv.APPID = "1";
            cv.USERID = "abc20190702";
            customerUserDal.SaveCustomerUser(cv);
        }
    }
}